package main

import (
	"flag"

	queryid "gitee.com/hlwqds/clientSimulation/src/moudles/queryId"
)

type config map[string]interface{}

func queryIDFlagSet(opts *queryid.Options) *flag.FlagSet {
	flagSet := flag.NewFlagSet("queryid", flag.ExitOnError)

	// basic options
	flagSet.Bool("version", false, "print version string")
	flagSet.String("config", "", "path to config file")
	flagSet.String("log-path", opts.LogPath, "path to log file")

	logLevel := opts.LogLevel
	flagSet.Var(&logLevel, "log-level", "set log verbosity: debug, info, warn, error, or fatal")
	flagSet.String("log-prefix", "[QueryId] ", "log message prefix")

	flagSet.String("http-address", opts.HTTPAddress, "<addr>:<port> to listen on for HTTP clients")
	flagSet.Duration("http-client-connect-timeout", opts.HTTPClientConnectTimeout, "timeout for HTTP connect")
	flagSet.Duration("http-client-request-timeout", opts.HTTPClientRequestTimeout, "timeout for HTTP request")

	flagSet.String("redis-address", opts.RedisAddress, "<addr>:<port> to visit redis server")
	flagSet.String("redis-password", opts.RedisPassword, "the password of redis server")

	return flagSet
}
